iptables-optimizer software package provides sort iptables rules by packet counters, you can install in your Debian 9 (Stretch) by running the commands given below on the terminal,
$ sudo apt-get update $ sudo apt-get install iptables-optimizer
iptables-optimizer is installed in your system.
Make ensure the iptables-optimizer package were installed using the commands given below,
$ sudo dpkg-query -l | grep iptables-optimizer *
You will get with iptables-optimizer package name, version, architecture and description in a table
| Distro | Debian 9 stretch |
| Section | Network |
| Package | iptables-optimizer |
| Version | 0.9.13-2 |
| Description | sort iptables rules by packet counters |
| Sub Section | Net |